# $Id$
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Kevin Piche <kevin@archlinux.org>

pkgname=perl-bit-vector
pkgver=7.4
pkgrel=6
pkgdesc='Efficient bit vector, set of integers and "big int" math library'
arch=('i686' 'x86_64')
license=('GPL' 'LGPL' 'PerlArtistic')
url="http://search.cpan.org/dist/Bit-Vector/"
depends=('perl-carp-clan')
options=('!emptydirs')
source=(http://search.cpan.org/CPAN/authors/id/S/ST/STBEY/Bit-Vector-${pkgver}.tar.gz)
md5sums=('bf67f144e5be5327ed79d4c69e6e0086')

build() {
  cd Bit-Vector-$pkgver
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd Bit-Vector-$pkgver
  make test
}

package() {
  cd Bit-Vector-$pkgver
  make DESTDIR="${pkgdir}" install
# template start; name=perl-binary-module-dependency; version=1;
if [[ $(find "$pkgdir/usr/lib/perl5/" -name "*.so") ]]; then
	_perlver_min=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]);')
	_perlver_max=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]+1);')
	depends+=("perl>=$_perlver_min" "perl<$_perlver_max")
fi
# template end;
}
